class Array

  def shuffle()
    sort_by do
     rand
    end
  end

  def shuffle!()
    replace(shuffle)
  end

  def random()
    rand
  end
end

class ShufflePlayer

  def initialize(files=[])
    @files = files
  end

  def play()
    @files.shuffle.each do |track|
      play_track(track)
    end
  end

  private
  def play_track(track)
    puts "mpcstar.exe #{track} /start 120000"
    system("mpcstar.exe '#{track}' /start 120000")
  end

end
puts ARGV
ShufflePlayer.new(ARGV).play()
